package com.macrohard.mapper.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;

/**
 * 系统菜单表
 * @TableName sys_menu
 */
@TableName(value ="sys_menu")
public class SysMenu implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 菜单
     */
    @TableField(value = "name")
    private String name;

    /**
     * 子菜单
     */
    @TableField(value = "function")
    private String function;

    /**
     * 地址
     */
    @TableField(value = "url")
    private String url;

    /**
     * 父菜单权重
     */
    @TableField(value = "fsign")
    private Integer fsign;

    /**
     * 菜单排序
     */
    @TableField(value = "sign")
    private Integer sign;

    @TableField(exist = false)
    private List<SysMenu> children;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public List<SysMenu> getChildren() {
        return children;
    }

    public void setChildren(List<SysMenu> children) {
        this.children = children;
    }

    /**
     * 
     */
    public Integer getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 菜单
     */
    public String getName() {
        return name;
    }

    /**
     * 菜单
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 子菜单
     */
    public String getFunction() {
        return function;
    }

    /**
     * 子菜单
     */
    public void setFunction(String function) {
        this.function = function;
    }

    /**
     * 地址
     */
    public String getUrl() {
        return url;
    }

    /**
     * 地址
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * 父菜单权重
     */
    public Integer getFsign() {
        return fsign;
    }

    /**
     * 父菜单权重
     */
    public void setFsign(Integer fsign) {
        this.fsign = fsign;
    }

    /**
     * 菜单排序
     */
    public Integer getSign() {
        return sign;
    }

    /**
     * 菜单排序
     */
    public void setSign(Integer sign) {
        this.sign = sign;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysMenu other = (SysMenu) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getFunction() == null ? other.getFunction() == null : this.getFunction().equals(other.getFunction()))
            && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
            && (this.getFsign() == null ? other.getFsign() == null : this.getFsign().equals(other.getFsign()))
            && (this.getSign() == null ? other.getSign() == null : this.getSign().equals(other.getSign()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getFunction() == null) ? 0 : getFunction().hashCode());
        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
        result = prime * result + ((getFsign() == null) ? 0 : getFsign().hashCode());
        result = prime * result + ((getSign() == null) ? 0 : getSign().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", function=").append(function);
        sb.append(", url=").append(url);
        sb.append(", fsign=").append(fsign);
        sb.append(", sign=").append(sign);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}